#ifndef TASKMANAGER_H
#define TASKMANAGER_H

#include <set>
#include <memory>

#include <QObject>
#include "ItemBrowserConfig.h"

enum class SearchMethod;
class TSearcherWindow;
class ItemBrowser;
class ItemsSearcher;
class BasicInformation;
class TaskManager : public QObject
{
    Q_OBJECT

public:
    TaskManager(TSearcherWindow *ts);
    ~TaskManager();
public:
    void start();
public slots:
    void on_fetchBasicInformation_finished();
public:
    // common arguments
    QString supportKeyword;
    double scrollInterval;

    // searcher arguments
    QString itemKeyword;
    QString itemLowerPrice;
    QString itemHigherPrice;
    QString sortBy;
    QString itemTitle;
    QString itemPrice;
    QString itemShopName;
    QString location;
    QString itemId;
    SearchMethod searchMethod;
    bool sendItemSelectedCapture;

    // basic information arguments
    bool ip;
    bool trades;
    bool rate;
    bool nickname;
    bool registerDate;

    // browser arguments
    ItemBrowserConfig mainBrowserConfig;
    ItemBrowserConfig subBrowserConfig;
    ItemBrowserConfig compareBrowserConfig;
    bool collectShopCapture = false;
    bool shopIndexCapture = false;
    int mainItemBrowsedNumber = 0;
    int subItemBrowsedNumber = 0;
    int compareItemBrowsedNumber = 0;
    
    std::unique_ptr<ItemsSearcher> itemsSearcher;
    std::unique_ptr<BasicInformation> basic;
public:
};

#endif // TASKMANAGER_H
